﻿using System;
using System.Collections.Generic;
using System.Text;

namespace IOP.OpenType
{
    /// <summary>
    /// 1-byte unsigned number specifies the 
    /// size of an Offset field or fields
    /// </summary>
    public struct OffSize
    {
        private byte Origin;
        /// <summary>
        /// 
        /// </summary>
        /// <param name="b"></param>
        public OffSize(byte b)
        {
            Origin = b;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public override string ToString() => Origin.ToString();

        /// <summary>
        /// 
        /// </summary>
        /// <param name="card"></param>
        public static implicit operator byte(OffSize card) => card.Origin;
        /// <summary>
        /// 
        /// </summary>
        /// <param name="b"></param>
        public static implicit operator OffSize(byte b) => new OffSize(b);
    }
}
